home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / breeze-server.txt < prev    next >
Encoding:
Internet Message Format  |  1999-03-24  |  6.6 KB

  1. Date: Sun, 27 Dec 1998 00:32:34 -0500
  2. From: //Stany <stany@HTTP.NOTBSD.ORG>
  3. To: BUGTRAQ@netspace.org
  4. Subject: Breeze Network Server remote reboot and other bogosity.
  5.  
  6. Good day.  I am Ortodox Christian, so my Christmas is on Jan 7th, but in
  7. the spirit of giving, I would like to submit the following rant.  It is
  8. rather lengthy, but IMHO is worth it.  If Aleph1 feels that it is too
  9. lengthy, feel free to snip the parts that are boring ;-)
  10.  
  11. A Breeze Network Server is a NetBSD 1.3.2 based system produced by
  12. WindDance Networks Corporation
  13. (http://www.winddancenet.com/products/breeze.html).  It is marketed as an
  14. email, fax, printer, internet/intranet web server and a  firewall.
  15. Physically it is an AMD K6/300 AFR system with 64 megs of RAM and 6 Gig
  16. IDE hard drive.  It includes a LS120 disk drive as the primary floppy
  17. drive, and according to the documentation that drive is used for
  18. distributing updates to the system.  The cost seems to be $3300 US.
  19.  
  20. The system is marketed to be easy in use ("so even the secretary would not
  21. have any problems to set up Breeze in 15 minutes") and upon receiving it
  22. one has to connect up a keyboard and a monitor to it, power it on, answer
  23. a few configuration questions (What is my ip?  What is my gateway?  What
  24. is my subnet?) and then one should be able to access it with a web browser
  25. and be able to modify all sorts of things - add users, back up the system,
  26. set up filesharing etc.  Following that, the keyboard and a screen are no
  27. longer needed.
  28.  
  29. I have to admit that this was the first time I ever used NetBSD, but
  30. it is close enough to Solaris/SunOS that I manage ;-)  However I might
  31. misinterpret important parts of NetBSD behavior, and if so, please
  32. correct me.  After all, maybe this is the way the system is designed to
  33. behave, and not the bastardization of WindDance Networks (Ugh.  I don't
  34. think so).
  35.  
  36. After this system have appeared in our office (I worked for PSInet Canada
  37. and we  were asked to evaluate if we would want to sell this to some of
  38. our customers), it have perked my curiosity, and one night I booted it
  39. into single user mode.  It have provided me with a root shell, so I have
  40. remounted / read-write and looked around.   gcc was installed.  This seems
  41. to be a first mistake - one doesn't install a compiler on a production
  42. system, especially on a secure one, as it makes it so much easier to
  43. compile a sniffer and cause more harm.  I have compiled ssh, installed it,
  44. and fixed my UID/GID to be zeros while I was at it ;-)  (BTW I realize
  45. that it seem to be a simple one line change to disallow a system to
  46. provide an unpassworded root shell upon being booted into a single user
  47. mode).
  48.  
  49. First thing I noticed once the system was running in multiuser mode was
  50. that apache was runing as root. IMHO this is another major problem, as
  51. apache should only need root to bind to socket. I decided to adjust the
  52. apache configuration files to use nobody as the default user, and once I
  53. have done that, I noticed that I could no longer even see the default
  54. starting page ("You have no permissions to access....").
  55.  
  56. I have decided to take a cursory look at the cgi-bin scripts that the
  57. system was using.  The scripts were not using any range checking nor
  58. sanity checks what so ever.  A particular script have attracted my
  59. attention:
  60. root@wdbreeze:/usr/local/breeze/cgi-bin[24]# tail -3 configbreeze
  61.  
  62. &rebootnow;
  63. exit 0;
  64. root@wdbreeze:/usr/local/breeze/cgi-bin[25]#
  65.  
  66. Ugh.  Is that not beautiful?
  67.  
  68. That's right, *anyone* accessing
  69. http://BreezenetworkserverIP/start/configbreeze
  70. is greeted with "Internal Server Error" message, while the system reboots
  71. itself.
  72.  
  73. It is interesting how the reboot is done as well: the script
  74. creates a file /tmp/reboot.now, and writes "Rest in Peace\n" into it.  A
  75. daemon /usr/local/breeze/bin/rebootwrapper checks (a cursory strings on
  76. rebootwrapper shows that the daemon is also checking for /tmp/halt.now).
  77. if that file exists, the contents of the file are checked against an
  78. internal lookup table, and then the system reboots itself through calling
  79. /sbin/reboot
  80.  
  81. I have done a few tests and another beautiful peecularity of the system
  82. came to light as well: if one creates an empty /tmp/reboot.now:
  83. root@wdbreeze:/[1]# cd /tmp
  84. root@wdbreeze:/tmp[2]# touch reboot.now
  85. the system doesn't reboot.  No, it just locks up, and closes all network
  86. ports, which is deadly for a system that should be a primary network
  87. gateway/firewall for a small business.  The behavior is very similar to
  88. halting the system, but the screen doesn't show the typical shutdown
  89. notices, and the last shows that the system was rebooted and not crashed.
  90. Oh, and the hard drive gets fscked on startup ;-)
  91.  
  92. So if I am a malicious script kiddie, who have managed to obtain any sort
  93. of login on the system, all I have to do is set up a simple cron job to
  94. touch /tmp/reboot.now every five or so minutes, and I am laughing.  It
  95. will take a good long while for someone to think about checking crontab on
  96. a system that all of a sudden started malfunctioning.  With the amount of
  97. ports running on that system some exploit is bound to appear at some point
  98. that will allow me  to get a remote login, or just add another line to
  99. root crontab.
  100.  
  101. So here is the question for the list:  What is the best way to make secure
  102. web interfaces to system functions like adding and deleting users or
  103. restarting systems?   I realize that the best solution would be to ship
  104. the system with ssh and allow a quilified administrator to log into the
  105. system (As I believe Corel allowes on their NetWinder Webserver or
  106. NetWinder Group Server to log in into a shell and have control over the
  107. system.  <http://www.corelcomputer.com/>) or ship the system with
  108. something like VNC <http://www.orl.co.uk/vnc/> that would allow an
  109. experienced user to connect to the X server and run software similar to
  110. RedHat Control Panel for system management, but once again there is an
  111. expense in training the user to be Unix "savvy".   In fact the question
  112. might well be is there a way to minimize a learning curve for the
  113. users/administrators with Windoze/MacOS experience (It seems to be the
  114. environment that both Corel with their NetWinder product and WindDance
  115. Networks with their Breeze product are aiming at) for maintaining/managing
  116. the UNIX based system without compromizing security?
  117.  
  118. //Stany, Sun Hardware Specialist, stany@notbsd.org
  119.  
  120. P.S. I have telephoned Mike Pelley, Software Designer of WindDance
  121. Networks about 2 weeks ago about the problems with their product, and was
  122. promised a swift update, but so far have not been contacted and to the
  123. best of my knoweledge the software update was not shipped to us.  I have
  124. cc:ed Mike to this message as well, and hope that someone at WindDance
  125. will get somehting done about the above.
  126.  
  127.